<?php
declare (strict_types = 1);

namespace app\admin\controller;

use app\admin\controller\Common;

class Index extends Common
{

	/**
	 * 构造方法
	 */
	public function __construct(){
		parent::__construct();	
	}
	
	/**
	 * 首页
	 */
	public function index(){

		/*
		$users_count = Db::name('member')->count();
		View::assign('users_count',$users_count);

		$news_count = Db::name('news')->count();
		View::assign('news_count',$news_count);

		$courselog_count = Db::name('courselog')->count();
		View::assign('courselog_count',$courselog_count);
		
		$newslog_count = Db::name('newslog')->count();
		View::assign('newslog_count',$newslog_count);

		$timeline = [];
		$memberline = [];
		$newslogline = [];
		for($i=5;$i>=0;$i--){
			$month = date('Y-m',strtotime('-'.$i.' month'));
			$timeline[] = $month;
			$newslogline[] = Db::name('newslog')->whereMonth('create_time',$month)->count();
			$memberline[] = Db::name('member')->whereMonth('create_time',$month)->count();
		}
		View::assign('timeline',json_encode($timeline));
		View::assign('memberline',json_encode($memberline));
		View::assign('newslogline',json_encode($newslogline));
		*/

		return view('index');
	}

}
